<?php
/**
 * 获取栏目的树状结构
 * @return [type] [description]
 */
function categoryTree($data,$pid=0,$level=0)
{
	foreach($data as $k=>$v)
	{
		$n = (count(explode('-', $v['path']))-1)*3;
		$data[$k]['_cname']=str_repeat('-',$n).$v['cname'];
	}
	return $data;
}
function p($data)
{
	echo "<pre>".print_r($data,true);
}